package distributedRE.model;

import qxtract.tuple.TupleReader;

public class Tuple {

	public static final int NO_ROOT_DETECTED = 0;
	private long rId;
	private long tId;
	private String text;
	private long trootRId;
	private long trootTID;
	private long trootIEId;
	private long ieId;
	private qxtract.tuple.Tuple tuple;

	public Tuple(long ieId, long rId, long tId, String text, long trootIEId, long trootRId, long trootTId) {
		this.ieId = ieId;
		this.rId = rId;
		this.tId = tId;
		this.text = text;
		this.trootIEId = trootIEId;
		this.trootRId = trootRId;
		this.trootTID = trootTId;
		tuple = TupleReader.generateTuple(text);
	}

	public qxtract.tuple.Tuple getProcessableTuple(){
		return tuple;
	}
	
	public long getId() {
		return tId;
	}
	
	public long getRelationId(){
		return rId;
	}

	public long getRootId() {
		return trootTID;
	}

	public String getText() {
		return text;
	}

	public Tuple getRootTuple() {
		//TODO Someday...
		return null;
		
	}

	public long getRootRelationId() {
		return trootRId;
	}

	public long getRootInformationExtractorId() {
		return trootIEId;
	}

	public boolean equals(Object o){
		
		Tuple t = (Tuple)o;
		
		return (tId == t.tId && rId == t.rId && ieId == t.ieId);
	}
	
}
